package com.example.controller.teacher;

import com.example.common.Result;
import com.example.entity.DTO.CourseDetailDTO;
import com.example.service.teacher.TeacherCourseService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/teacher")
public class TeacherCourseController {
    @Resource
    private TeacherCourseService teacherCourseService;

    /**
     * 获取教师授课课程信息
     */
    @GetMapping("/selectAllCourse/{teacherId}")
    public Result selectAllCourse(@PathVariable Integer teacherId) {
        List<CourseDetailDTO> teacherCourses = teacherCourseService.selectAllCourse(teacherId);
        return Result.success(teacherCourses);
    }
}
